﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Utilities
{
    public enum CodeType
    {
        Lot,
        ProductTS,
        ProductTC,
        Test,
        Order,
        DeliveryPlan,
        Command,
        InOut,
        IdemnifyProduct
    }
    public class GenerateCode
    {
        public static string GetCode(int index, CodeType codeType)
        {
            string result = string.Empty;
            switch (codeType)
            {
                case CodeType.Lot: result = "LO" + index.ToString("00000");
                    break;
                case CodeType.ProductTS: result = "TS" + index.ToString("0000000");
                    break;
                case CodeType.ProductTC: result = "TC" + index.ToString("0000000");
                    break;
                case CodeType.Test: result = "KNC" + index.ToString("00000000");
                    break;
                case CodeType.Order: result = "DH" + index.ToString("00000000");
                    break;
                case CodeType.DeliveryPlan: result = "KHGH" + index.ToString("0000000");
                    break;
                case CodeType.Command: result = "PDX" + index.ToString("0000000");
                    break;
                case CodeType.InOut: result = "IO" + index.ToString("0000000");
                    break;
                case CodeType.IdemnifyProduct: result = "IP" + index.ToString("0000000");
                    break;
                default: break;
            }
            return result;
        }
    }
}
